home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / QuickdrawText.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  11.1 KB  |  404 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QuickdrawText.a
  3. ;
  4. ;    Contains:    Quickdraw Text Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1983-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__QUICKDRAWTEXT__') = 'UNDEFINED' THEN
  18. __QUICKDRAWTEXT__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  24.     include 'MixedMode.a'
  25.     ENDIF
  26.  
  27. ;  new CGrafPort bottleneck ("newProc2") function, used in Unicode Text drawing 
  28. ;
  29. ; extern OSStatus StandardGlyphs(void *dataStream, ByteCount size)
  30. ;
  31.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  32.         IMPORT_CFM_FUNCTION StandardGlyphs
  33.     ENDIF
  34.  
  35.  
  36.  
  37.                                                             ; CharToPixel directions 
  38. leftCaret                        EQU        0                    ;Place caret for left block
  39. rightCaret                        EQU        -1                    ;Place caret for right block
  40. kHilite                            EQU        1                    ;Direction is SysDirection
  41. smLeftCaret                        EQU        0                    ;Place caret for left block - obsolete 
  42. smRightCaret                    EQU        -1                    ;Place caret for right block - obsolete 
  43. smHilite                        EQU        1                    ;Direction is TESysJust - obsolete 
  44.  
  45.                                                             ;Constants for styleRunPosition argument in PortionLine, DrawJustified, MeasureJustified, CharToPixel, and PixelToChar.
  46. onlyStyleRun                    EQU        0                    ; This is the only style run on the line 
  47. leftStyleRun                    EQU        1                    ; This is leftmost of multiple style runs on the line 
  48. rightStyleRun                    EQU        2                    ; This is rightmost of multiple style runs on the line 
  49. middleStyleRun                    EQU        3                    ; There are multiple style runs on the line and this is neither the leftmost nor the rightmost. 
  50. smOnlyStyleRun                    EQU        0                    ; obsolete 
  51. smLeftStyleRun                    EQU        1                    ; obsolete 
  52. smRightStyleRun                    EQU        2                    ; obsolete 
  53. smMiddleStyleRun                EQU        3                    ; obsolete 
  54. ;  type for styleRunPosition parameter in PixelToChar etc. 
  55. ; typedef short                         JustStyleCode
  56.  
  57. FontInfo                RECORD 0
  58. ascent                     ds.w    1                ; offset: $0 (0)
  59. descent                     ds.w    1                ; offset: $2 (2)
  60. widMax                     ds.w    1                ; offset: $4 (4)
  61. leading                     ds.w    1                ; offset: $6 (6)
  62. sizeof                     EQU *                    ; size:   $8 (8)
  63.                         ENDR
  64. FormatOrder                RECORD 0
  65. elements                 ds.w    1
  66. sizeof                     EQU *                    ; size:   $2 (2)
  67.                         ENDR
  68.  
  69.  
  70. ; typedef FormatOrder *                    FormatOrderPtr
  71.  
  72. ;  FormatStatus was moved to TextUtils.i 
  73. OffPair                    RECORD 0
  74. offFirst                 ds.w    1                ; offset: $0 (0)
  75. offSecond                 ds.w    1                ; offset: $2 (2)
  76. sizeof                     EQU *                    ; size:   $4 (4)
  77.                         ENDR
  78. OffsetTable                RECORD 0
  79. elements                 ds.b    3 * OffPair.sizeof
  80. sizeof                     EQU *                    ; size:   $C (12)
  81.                         ENDR
  82.  
  83.  
  84. ;
  85. ; pascal short Pixel2Char(Ptr textBuf, short textLen, short slop, short pixelWidth, Boolean *leadingEdge)
  86. ;
  87.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  88.         Macro
  89.         _Pixel2Char
  90.             move.l              #$820E0014,-(sp)
  91.             dc.w                $A8B5
  92.         EndM
  93.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  94.         IMPORT_CFM_FUNCTION Pixel2Char
  95.     ENDIF
  96.  
  97. ;
  98. ; pascal short Char2Pixel(Ptr textBuf, short textLen, short slop, short offset, short direction)
  99. ;
  100.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  101.         Macro
  102.         _Char2Pixel
  103.             move.l              #$820C0016,-(sp)
  104.             dc.w                $A8B5
  105.         EndM
  106.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  107.         IMPORT_CFM_FUNCTION Char2Pixel
  108.     ENDIF
  109.  
  110. ;
  111. ; pascal short PixelToChar(Ptr textBuf, long textLength, Fixed slop, Fixed pixelWidth, Boolean *leadingEdge, Fixed *widthRemaining, JustStyleCode styleRunPosition, Point numer, Point denom)
  112. ;
  113.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  114.         Macro
  115.         _PixelToChar
  116.             move.l              #$8222002E,-(sp)
  117.             dc.w                $A8B5
  118.         EndM
  119.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  120.         IMPORT_CFM_FUNCTION PixelToChar
  121.     ENDIF
  122.  
  123. ;
  124. ; pascal short CharToPixel(Ptr textBuf, long textLength, Fixed slop, long offset, short direction, JustStyleCode styleRunPosition, Point numer, Point denom)
  125. ;
  126.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  127.         Macro
  128.         _CharToPixel
  129.             move.l              #$821C0030,-(sp)
  130.             dc.w                $A8B5
  131.         EndM
  132.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  133.         IMPORT_CFM_FUNCTION CharToPixel
  134.     ENDIF
  135.  
  136. ;
  137. ; pascal void DrawJustified(Ptr textPtr, long textLength, Fixed slop, JustStyleCode styleRunPosition, Point numer, Point denom)
  138. ;
  139.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  140.         Macro
  141.         _DrawJustified
  142.             move.l              #$80160032,-(sp)
  143.             dc.w                $A8B5
  144.         EndM
  145.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  146.         IMPORT_CFM_FUNCTION DrawJustified
  147.     ENDIF
  148.  
  149. ;
  150. ; pascal void MeasureJustified(Ptr textPtr, long textLength, Fixed slop, Ptr charLocs, JustStyleCode styleRunPosition, Point numer, Point denom)
  151. ;
  152.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  153.         Macro
  154.         _MeasureJustified
  155.             move.l              #$801A0034,-(sp)
  156.             dc.w                $A8B5
  157.         EndM
  158.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  159.         IMPORT_CFM_FUNCTION MeasureJustified
  160.     ENDIF
  161.  
  162. ;
  163. ; pascal Fixed PortionLine(Ptr textPtr, long textLen, JustStyleCode styleRunPosition, Point numer, Point denom)
  164. ;
  165.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  166.         Macro
  167.         _PortionLine
  168.             move.l              #$84120036,-(sp)
  169.             dc.w                $A8B5
  170.         EndM
  171.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  172.         IMPORT_CFM_FUNCTION PortionLine
  173.     ENDIF
  174.  
  175. ;
  176. ; pascal void HiliteText(Ptr textPtr, short textLength, short firstOffset, short secondOffset, OffsetTable offsets)
  177. ;
  178.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  179.         Macro
  180.         _HiliteText
  181.             move.l              #$800E001C,-(sp)
  182.             dc.w                $A8B5
  183.         EndM
  184.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  185.         IMPORT_CFM_FUNCTION HiliteText
  186.     ENDIF
  187.  
  188. ;
  189. ; pascal void DrawJust(Ptr textPtr, short textLength, short slop)
  190. ;
  191.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  192.         Macro
  193.         _DrawJust
  194.             move.l              #$8008001E,-(sp)
  195.             dc.w                $A8B5
  196.         EndM
  197.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  198.         IMPORT_CFM_FUNCTION DrawJust
  199.     ENDIF
  200.  
  201. ;
  202. ; pascal void MeasureJust(Ptr textPtr, short textLength, short slop, Ptr charLocs)
  203. ;
  204.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  205.         Macro
  206.         _MeasureJust
  207.             move.l              #$800C0020,-(sp)
  208.             dc.w                $A8B5
  209.         EndM
  210.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  211.         IMPORT_CFM_FUNCTION MeasureJust
  212.     ENDIF
  213.  
  214. ;
  215. ; pascal Fixed PortionText(Ptr textPtr, long textLength)
  216. ;
  217.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  218.         Macro
  219.         _PortionText
  220.             move.l              #$84080024,-(sp)
  221.             dc.w                $A8B5
  222.         EndM
  223.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  224.         IMPORT_CFM_FUNCTION PortionText
  225.     ENDIF
  226.  
  227. ;
  228. ; pascal long VisibleLength(Ptr textPtr, long textLength)
  229. ;
  230.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  231.         Macro
  232.         _VisibleLength
  233.             move.l              #$84080028,-(sp)
  234.             dc.w                $A8B5
  235.         EndM
  236.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  237.         IMPORT_CFM_FUNCTION VisibleLength
  238.     ENDIF
  239.  
  240. ;
  241. ; pascal void GetFormatOrder(FormatOrderPtr ordering, short firstFormat, short lastFormat, Boolean lineRight, StyleRunDirectionUPP rlDirProc, Ptr dirParam)
  242. ;
  243.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  244.         Macro
  245.         _GetFormatOrder
  246.             move.l              #$8012FFFC,-(sp)
  247.             dc.w                $A8B5
  248.         EndM
  249.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  250.         IMPORT_CFM_FUNCTION GetFormatOrder
  251.     ENDIF
  252.  
  253.  
  254.  
  255. ;
  256. ; pascal void TextFont(short font)
  257. ;
  258.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  259.         _TextFont:    OPWORD    $A887
  260.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  261.         IMPORT_CFM_FUNCTION TextFont
  262.     ENDIF
  263.  
  264. ;
  265. ; pascal void TextFace(StyleParameter face)
  266. ;
  267.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  268.         _TextFace:    OPWORD    $A888
  269.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  270.         IMPORT_CFM_FUNCTION TextFace
  271.     ENDIF
  272.  
  273. ;
  274. ; pascal void TextMode(short mode)
  275. ;
  276.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  277.         _TextMode:    OPWORD    $A889
  278.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  279.         IMPORT_CFM_FUNCTION TextMode
  280.     ENDIF
  281.  
  282. ;
  283. ; pascal void TextSize(short size)
  284. ;
  285.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  286.         _TextSize:    OPWORD    $A88A
  287.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  288.         IMPORT_CFM_FUNCTION TextSize
  289.     ENDIF
  290.  
  291. ;
  292. ; pascal void SpaceExtra(Fixed extra)
  293. ;
  294.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  295.         _SpaceExtra:    OPWORD    $A88E
  296.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  297.         IMPORT_CFM_FUNCTION SpaceExtra
  298.     ENDIF
  299.  
  300. ;
  301. ; pascal void DrawChar(CharParameter ch)
  302. ;
  303.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  304.         _DrawChar:    OPWORD    $A883
  305.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  306.         IMPORT_CFM_FUNCTION DrawChar
  307.     ENDIF
  308.  
  309. ;
  310. ; pascal void DrawString(ConstStr255Param s)
  311. ;
  312.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  313.         _DrawString:    OPWORD    $A884
  314.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  315.         IMPORT_CFM_FUNCTION DrawString
  316.     ENDIF
  317.  
  318. ;
  319. ; pascal void DrawText(const void *textBuf, short firstByte, short byteCount)
  320. ;
  321.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  322.         _DrawText:    OPWORD    $A885
  323.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  324.         IMPORT_CFM_FUNCTION DrawText
  325.     ENDIF
  326.  
  327. ;
  328. ; pascal short CharWidth(CharParameter ch)
  329. ;
  330.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  331.         _CharWidth:    OPWORD    $A88D
  332.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  333.         IMPORT_CFM_FUNCTION CharWidth
  334.     ENDIF
  335.  
  336. ;
  337. ; pascal short StringWidth(ConstStr255Param s)
  338. ;
  339.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  340.         _StringWidth:    OPWORD    $A88C
  341.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  342.         IMPORT_CFM_FUNCTION StringWidth
  343.     ENDIF
  344.  
  345. ;
  346. ; pascal short TextWidth(const void *textBuf, short firstByte, short byteCount)
  347. ;
  348.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  349.         _TextWidth:    OPWORD    $A886
  350.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  351.         IMPORT_CFM_FUNCTION TextWidth
  352.     ENDIF
  353.  
  354. ;
  355. ; pascal void MeasureText(short count, const void *textAddr, void *charLocs)
  356. ;
  357.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  358.         _MeasureText:    OPWORD    $A837
  359.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  360.         IMPORT_CFM_FUNCTION MeasureText
  361.     ENDIF
  362.  
  363. ;
  364. ; pascal void GetFontInfo(FontInfo *info)
  365. ;
  366.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  367.         _GetFontInfo:    OPWORD    $A88B
  368.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  369.         IMPORT_CFM_FUNCTION GetFontInfo
  370.     ENDIF
  371.  
  372. ;
  373. ; pascal void CharExtra(Fixed extra)
  374. ;
  375.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  376.         _CharExtra:    OPWORD    $AA23
  377.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  378.         IMPORT_CFM_FUNCTION CharExtra
  379.     ENDIF
  380.  
  381. ;
  382. ; pascal void StdText(short count, const void *textAddr, Point numer, Point denom)
  383. ;
  384.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  385.         _StdText:    OPWORD    $A882
  386.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  387.         IMPORT_CFM_FUNCTION StdText
  388.     ENDIF
  389.  
  390. ;
  391. ; pascal short StdTxMeas(short byteCount, const void *textAddr, Point *numer, Point *denom, FontInfo *info)
  392. ;
  393.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  394.         _StdTxMeas:    OPWORD    $A8ED
  395.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  396.         IMPORT_CFM_FUNCTION StdTxMeas
  397.     ENDIF
  398.  
  399.  
  400.     IF OLDROUTINENAMES THEN
  401.     ENDIF    ; OLDROUTINENAMES
  402.     ENDIF ; __QUICKDRAWTEXT__ 
  403.  
  404.